# the wxChoice() widget, a simple dropdown box 
# wx.Choice(parent, id, pos, size, choices, style) 
# tested with Python24 and wxPython26 
# should work on Windows, Linux, and Unix systems 

import wx 

class MyFrame(wx.Frame): 
    """ class MyFrame inherits wxFrame, uses default ID of -1""" 
    def __init__(self ): 
        wx.Frame.__init__(self, None, -1, 'wxChoice test', size=(300, 150)) 

        MemberList = ['0879263758', '0876439019'] 
        # create the dropdown box 
        self.choice1 = wx.Choice(self, -1, choices=MemberList)
        
        # select item 1 = 'green' to show 
        self.choice1.SetSelection(1)
        
        # set focus to receive optional keyboard input 
        # eg. type r for red, y for yellow 
        self.choice1.SetFocus()
        
        # new event handler wxPython version 2.5 and higher 
        self.choice1.Bind(wx.EVT_CHOICE, self.onChoice) 
         
    def onChoice(self, event): 
        '''get the slected color choice''' 
        self.color = self.choice1.GetStringSelection() 
        self.SetTitle(self.color)  # test <--- set the title ...
         

# this is only a small application 
application = wx.PySimpleApp() 
# call class MyFrame 
frame1 = MyFrame() 
# show the frame 
frame1.Show(True) 
# start the event loop 
application.MainLoop()  
